/* 动画效果样式 */

/* 数字雨粒子效果 */
.matrix-particle {
    position: absolute;
    color: var(--accent-color);
    font-family: var(--font-mono);
    font-size: 14px;
    opacity: 0;
    animation: fadeInOut 2s ease-in-out;
    pointer-events: none;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { opacity: 0; }
}

/* 鼠标光标粒子效果 */
.cursor-particle {
    position: absolute;
    background-color: var(--accent-color);
    width: 2px;
    height: 2px;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.8;
    z-index: 1000;
}

/* 全息波纹效果 */
.hologram-ripple {
    position: absolute;
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    opacity: 1;
    pointer-events: none;
    z-index: 1000;
    animation: rippleEffect 1s cubic-bezier(0, 0.5, 0.5, 1) forwards;
}

@keyframes rippleEffect {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

/* 点击波纹效果 */
.click-ripple {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    background: transparent;
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 10px var(--accent-color);
    z-index: 9999;
    animation: clickRipple 1s cubic-bezier(0, 0.5, 0.5, 1) forwards;
}

@keyframes clickRipple {
    0% {
        width: 0;
        height: 0;
        opacity: 0.8;
    }
    100% {
        width: 150px;
        height: 150px;
        opacity: 0;
    }
}

/* 二进制数字消散效果 */
.binary-digit {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--accent-color);
    opacity: 1;
    pointer-events: none;
    animation: binaryFade 1.5s ease-out forwards;
}

@keyframes binaryFade {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* 故障效果 */
.glitch-effect {
    position: absolute;
    background-color: rgba(0, 247, 255, 0.2);
    mix-blend-mode: screen;
    pointer-events: none;
    animation: glitchAnimation 0.3s linear;
}

@keyframes glitchAnimation {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 0; }
}

/* 按钮悬停波纹效果 */
.ripple-effect {
    position: absolute;
    background-color: rgba(0, 247, 255, 0.3);
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* 页面切换扫描线效果 */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 247, 255, 0.2) 50%,
        transparent 100%
    );
    z-index: 1000;
    pointer-events: none;
    animation: pageTransition 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}

@keyframes pageTransition {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* 模块边框呼吸灯效果 */
.pulse-border {
    animation: pulseBorder 2s infinite;
}

@keyframes pulseBorder {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 247, 255, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 247, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 247, 255, 0);
    }
}

/* 打字机效果 */
.typing-animation {
    overflow: hidden;
    border-right: 2px solid var(--accent-color);
    white-space: nowrap;
    margin: 0;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--accent-color) }
}

/* 3D翻转效果增强 */
.project-card:hover .card-inner {
    transform: rotateY(180deg);
    box-shadow: 0 0 20px rgba(0, 247, 255, 0.3);
}

/* 视差滚动效果 */
.parallax-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -1;
    opacity: 0.3;
    pointer-events: none;
    transition: transform 0.1s ease-out;
}

/* 技能树节点动画 */
.skill-node {
    opacity: 0;
    transform: scale(0.8);
    animation: nodeGrow 0.5s ease-out forwards;
}

@keyframes nodeGrow {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 技能连接线动画 */
.skill-connection {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawLine 2s ease-out forwards;
}

@keyframes drawLine {
    to {
        stroke-dashoffset: 0;
    }
}

/* 闪烁的下划线光标 */
.cursor-blink {
    display: inline-block;
    width: 10px;
    height: 20px;
    background-color: var(--accent-color);
    animation: cursorBlink 1s step-end infinite;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* GLITCH故障特效 */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 var(--accent-color);
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-1 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 var(--accent-color-alt);
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim-2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% { clip: rect(52px, 9999px, 41px, 0); }
    5% { clip: rect(21px, 9999px, 76px, 0); }
    10% { clip: rect(92px, 9999px, 61px, 0); }
    15% { clip: rect(8px, 9999px, 85px, 0); }
    20% { clip: rect(46px, 9999px, 15px, 0); }
    25% { clip: rect(65px, 9999px, 91px, 0); }
    30% { clip: rect(84px, 9999px, 26px, 0); }
    35% { clip: rect(75px, 9999px, 71px, 0); }
    40% { clip: rect(41px, 9999px, 24px, 0); }
    45% { clip: rect(44px, 9999px, 90px, 0); }
    50% { clip: rect(91px, 9999px, 57px, 0); }
    55% { clip: rect(91px, 9999px, 93px, 0); }
    60% { clip: rect(56px, 9999px, 30px, 0); }
    65% { clip: rect(69px, 9999px, 56px, 0); }
    70% { clip: rect(34px, 9999px, 33px, 0); }
    75% { clip: rect(93px, 9999px, 64px, 0); }
    80% { clip: rect(15px, 9999px, 39px, 0); }
    85% { clip: rect(13px, 9999px, 82px, 0); }
    90% { clip: rect(56px, 9999px, 97px, 0); }
    95% { clip: rect(5px, 9999px, 52px, 0); }
    100% { clip: rect(49px, 9999px, 92px, 0); }
}

@keyframes glitch-anim-2 {
    0% { clip: rect(70px, 9999px, 46px, 0); }
    5% { clip: rect(67px, 9999px, 10px, 0); }
    10% { clip: rect(75px, 9999px, 10px, 0); }
    15% { clip: rect(73px, 9999px, 5px, 0); }
    20% { clip: rect(96px, 9999px, 91px, 0); }
    25% { clip: rect(95px, 9999px, 68px, 0); }
    30% { clip: rect(22px, 9999px, 19px, 0); }
    35% { clip: rect(49px, 9999px, 44px, 0); }
    40% { clip: rect(2px, 9999px, 29px, 0); }
    45% { clip: rect(99px, 9999px, 100px, 0); }
    50% { clip: rect(38px, 9999px, 92px, 0); }
    55% { clip: rect(83px, 9999px, 54px, 0); }
    60% { clip: rect(33px, 9999px, 78px, 0); }
    65% { clip: rect(85px, 9999px, 31px, 0); }
    70% { clip: rect(13px, 9999px, 87px, 0); }
    75% { clip: rect(45px, 9999px, 42px, 0); }
    80% { clip: rect(42px, 9999px, 1px, 0); }
    85% { clip: rect(28px, 9999px, 52px, 0); }
    90% { clip: rect(41px, 9999px, 89px, 0); }
    95% { clip: rect(67px, 9999px, 79px, 0); }
    100% { clip: rect(18px, 9999px, 51px, 0); }
}
